<?php
    require_once('tpl/header.php');
    require_once("../system/loginCheck.php");
    require_once("../system/dbConn.php");
    connect();
?>

<?php 
    $vid=$_GET["vid"];
    $sql0="select * from videos where vid=$vid";
    $result0=mysql_query($sql0);//一条记录的结果集
    $row0=mysql_fetch_assoc($result0);
 ?>

<form class="form-horizontal" action="doVideoUpdate.php" method="post" enctype="multipart/form-data">
        <input type="hidden" name="vid" value="<?php echo $vid;?>">
        <div class="form-group">
            <label for="inputEmail3" class="col-md-2 control-label">视频名称</label>
            <div class="col-md-6">
                <input type="text" class="form-control" name="videoname" id="inputEmail3" value="<?php echo $row0['videoname']?>">
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword2" class="col-md-2 control-label">视频类型</label>
            <div class="col-md-6">
                <?php 
                    $sql="select * from videotype";
                    $result=mysql_query($sql);
                 ?>
                <select class="form-control" name="videotype" id="inputPassword2">
                    <?php 
                    while ($row=mysql_fetch_assoc($result)) {
                    ?>
                        <option value="<?php echo $row['tid']?>" <?php if ($row0['tid']==$row['tid']) {
                                echo "selected";
                        } ?>><?php echo $row["typename"];?>
                            
                        </option>
                    <?php   
                    }
                     ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword3" class="col-md-2 control-label">视频海报</label>
            <div class="col-md-6">
                <input type="file"  name="pic" id="inputPassword3">
                原海报：<img src="../posters/<?php echo $row0["pic"];
                ?>" width="80px" height="80px" class="img-circle">
             </div>
        </div>
        <div class="form-group">
            <label for="inputPassword4" class="col-md-2 control-label">视频简介</label>
            <div class="col-md-6">
                <textarea name="intro" cols="60" rows="5" id="inputPassword4"><?php echo $row0['intro']; ?></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="inputPassword5" class="col-md-2 control-label">下载地址</label>
            <div class="col-md-6">
                <input type="text" class="form-control" name="address" id="inputPassword5" value="<?php echo$row0['address'] ?>">
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="修改" class="btn btn-default">
            </div>
        </div>
    </form>
   


<?php
  require_once('tpl/footer.php');
?>
